数据分析工具 Zeppelin

Zeppelin概述

Apache Zeppelin 是一个让交互式数据分析变得可行的基于网页的notebook。Zeppelin提供了数据可视化的框架. 官网地址: http://zeppelin.apache.org/

Zeppelin下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@icloud-store local]# wget http://mirror.bit.edu.cn/apache/zeppelin/zeppelin-0.7.3/zeppelin-0.7.3-bin-all.tgz
[root@icloud-store local]# tar -zxvf zeppelin-0.7.3-bin-all.tgz
[root@icloud-store zeppelin-0.7.3-bin-all]# ll -h
总用量 28M
drwxr-xr-x 2 501 wheel 4.0K 2月 26 03:29 bin
drwxr-xr-x 2 501 wheel 4.0K 2月 26 03:29 conf
drwxr-xr-x 23 501 wheel 4.0K 2月 26 03:28 interpreter
drwxr-xr-x 4 501 wheel 8.0K 2月 26 03:28 lib
-rw-r--r-- 1 501 wheel 59K 9月 18 10:14 LICENSE
drwxr-xr-x 2 501 wheel 4.0K 2月 26 03:28 licenses
drwxr-xr-x 8 501 wheel 102 2月 26 03:28 notebook
-rw-r--r-- 1 501 wheel 5.5K 9月 18 10:14 NOTICE
-rw-r--r-- 1 501 wheel 1.3K 9月 18 10:07 README.md
-rw-r--r-- 1 501 wheel 28M 9月 18 10:13 zeppelin-web-0.7.3.war
[root@icloud-store zeppelin-0.7.3-bin-all]# ls bin/
common.cmd functions.cmd install-interpreter.sh interpreter.sh zeppelin-daemon.sh
common.sh functions.sh interpreter.cmd zeppelin.cmd zeppelin.sh
[root@icloud-store zeppelin-0.7.3-bin-all]# ls conf/
configuration.xsl log4j.properties zeppelin-env.cmd.template zeppelin-site.xml.template
interpreter-list shiro.ini.template zeppelin-env.sh.template
[root@icloud-store zeppelin-0.7.3-bin-all]# ls interpreter/
alluxio bqsql elasticsearch flink ignite kylin lib md psql scio spark
angular cassandra file hbase jdbc lens livy pig python sh

Zeppelin部署

Zeppelin部署前提是安装了JDK(建议JDK8). 安装过程比较简单,部署其应用war包即可.

Zeppelin解释器

查看其支持的解释器,内置解释器列表.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[root@icloud-store zeppelin-0.7.3-bin-all]# bin/install-interpreter.sh --list
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/zeppelin-0.7.3-bin-all/lib/interpreter/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/zeppelin-0.7.3-bin-all/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
alluxio Alluxio interpreter
angular HTML and AngularJS view rendering
beam Beam interpreter
bigquery BigQuery interpreter
cassandra Cassandra interpreter built with Scala 2.11
elasticsearch Elasticsearch interpreter
file HDFS file interpreter
flink Flink interpreter built with Scala 2.11
hbase Hbase interpreter
ignite Ignite interpreter built with Scala 2.11
jdbc Jdbc interpreter
kylin Kylin interpreter
lens Lens interpreter
livy Livy interpreter
md Markdown support
pig Pig interpreter
postgresql Postgresql interpreter
python Python interpreter
scio Scio interpreter
shell Shell command

[root@icloud-store zeppelin-0.7.3-bin-all]# cd conf/
[root@icloud-store conf]#
[root@icloud-store conf]# cat interpreter-list
[root@icloud-store conf]# cat zeppelin-site.xml -n | grep -C 3 interpreter

安装特定解释器

1
[root@icloud-store zeppelin-0.7.3-bin-all]# bin/install-interpreter.sh --name md,shell,jdbc,python

安装全部解释器

1
2

[root@localhost zeppelin-0.7.3-bin-all]# bin/install-interpreter.sh --all

Zeppelin启动

1
2
3
4
5
[root@icloud-store zeppelin-0.7.3-bin-all]# cp conf/zeppelin-env.sh.template conf/zeppelin-env.sh
[root@icloud-store zeppelin-0.7.3-bin-all]# cp conf/zeppelin-site.xml.template conf/zeppelin-site.xml
[root@icloud-store zeppelin-0.7.3-bin-all]# bin/zeppelin-daemon.sh start
Pid dir doesn't exist, create /usr/local/zeppelin-0.7.3-bin-all/run
Zeppelin start [ OK ]

效果图如下

Zeppelin应用

Zeppelin基于其特定的解释器,可以做一些简单的数据可视化图标展示, 下面概述如何基于特定解释器创建可视化数据图表.

解释器Markdown

步骤: 【Notebook】->【Create new note】, 解释器选择md即可会出现一个展示面板,编辑运行即可.

效果如下:

解释器Elastic

解释器选择: elasticsearch. 当然需要在Interpreter中事先配置好解释器

当然也支持不同的图标效果展示

整体来说比较简单, 不做赘述.